package qc.module.ehs.mapper;

import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.factory.Mappers;
import qc.module.ehs.dto.taskgroup.TaskGroupAddDto;
import qc.module.ehs.dto.taskgroup.TaskGroupInfoDto;
import qc.module.ehs.entity.EhsTaskGroup;

import java.util.List;

@Mapper
public interface EhsTaskGroupMapper {
    EhsTaskGroupMapper MAPPER = Mappers.getMapper(EhsTaskGroupMapper.class);

    @Mapping(target = "latestexecendtm", source = "latestexecendtm", dateFormat = "yyyy-MM-dd HH:mm:ss")
    TaskGroupInfoDto toDto(EhsTaskGroup en);
    
    List<TaskGroupInfoDto> toDtoList(List<EhsTaskGroup> ens);

    @Mapping(target = "odr",source = "odr")
    EhsTaskGroup toEntity(TaskGroupAddDto addDto);
    
}
